package com.caisejingyu.whales.home.devices.printer;

import static com.caisejingyu.whales.home.devices.printer.PrintPageConstants.PRINT_PAGE_TYPE_A6;
import static com.caisejingyu.whales.home.devices.printer.PrintPageConstants.PRINT_PAGE_TYPE_A7_1;

/**
 * Created by fengxing on 2017/2/22.
 */

public class PrintFaceFactory {
    private static IPrintExcute a7 = null;
    private static IPrintExcute a71 = null;
    private static IPrintExcute a6 = null;

    public static IPrintExcute getPrinterFace(int type) {
        switch (type) {
            case PRINT_PAGE_TYPE_A7_1:
                if (a71 == null) {
                    a71 = new A7ExImageProcessor();
                }
                return a71;
            case PRINT_PAGE_TYPE_A6:
                if (a6 == null) {
                    a6 = new A6ImageProcessor();
                }
                return a6;
            default:
                if (a7 == null) {
                    a7 = new A7ImageProcessor();
                }
                return a7;
        }
    }
}
